lectures.alex.balgavy.eu

Lecture notes from university.
git clone git://git.alex.balgavy.eu/lectures.alex.balgavy.eu.git
Log | Files | Refs | Submodules

Data dependencies.html (2939B)


      1 <?xml version="1.0" encoding="UTF-8"?>
      2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      3 <html><head><link rel="stylesheet" href="sitewide.css" /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><meta name="exporter-version" content="Evernote Mac 6.13.1 (455785)"/><meta name="altitude" content="-0.2610844969749451"/><meta name="author" content="Alex Balgavy"/><meta name="created" content="2017-12-18 12:26:00 PM +0000"/><meta name="latitude" content="52.37360997359432"/><meta name="longitude" content="4.836342293930081"/><meta name="source" content="desktop.mac"/><meta name="updated" content="2017-12-18 12:45:19 PM +0000"/><title>Data dependencies</title></head><body><div>instructions:</div><div><font face="Courier New">Add R2, R3, #100</font></div><div><font face="Courier New">Subtract R9, R2, #30</font></div><div><font face="Courier New"><br/></font></div><div><font face="Helvetica Neue">R2 is destination for add, and source for subtract</font></div><div><font face="Helvetica Neue">there is a data dependency between the instructions</font></div><div><font face="Helvetica Neue">subtract has to be stalled, like this:</font></div><div><ol><li><font face="Helvetica Neue">Control circuit recognises data dependency when it decodes subtract instruction (compare source/destination registers)</font></li><li><font style="font-family: &quot;Helvetica Neue&quot;;">Subtract instruction is held in interstage buffer B1 during cycles 3-5</font></li><li><font face="Helvetica Neue"><span style="font-family: &quot;Helvetica Neue&quot;;">Add instruction proceeds, s</span>ignals are set in interstage buffer B2 for implicit NOP (no operation) instruction — creates a ‘bubble’ (clock cycle of idle time)</font></li></ol></div><div><font face="Helvetica Neue"><br/></font></div><div><img src="Data%20dependencies.resources/screenshot_1.png" height="221" width="857"/></div><div><br/></div><div><br/></div><div>the stalls can be alleviated using operand forwarding:</div><div><ul><li>in the above example, value is available at the end of cycle 3</li><li>hardware implementation</li><ul><li>hardware can forward the value from RZ to where it’s needed</li><li>modification of datapath needed (new multiplexer)</li></ul><li>software implementation</li><ul><li>compiler can identify dependencies and insert NOPs</li><li>does not decrease time, increases code size</li><li>but hardware isn’t as complicated</li></ul></ul><div><br/></div></div><div>the result of hardware implementation looks like this:</div><div><br/></div><div><img src="Data%20dependencies.resources/screenshot_2.png" height="226" width="674"/></div><div><br/></div><div>The new datapath, incorporating operand forwarding:</div><div><br/></div><div><img src="Data%20dependencies.resources/screenshot.png" height="882" width="537"/></div><div><br/></div></body></html>